<%@page import="shops.CartItem"%>
<%@page import="java.util.HashSet"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<table id="CartList" width="90%" cellpadding="10" align="center" class="legend">
            <tr>
                <td align="center" style="width:10% ">產品縮圖</td>
                <td align="center">產品名稱</td>
                <td align="center">產品種類</td>
                <td align="center">單價</td>
                <td align="center">數量</td>
                <td align="center">金額小計</td>
            </tr>
     
            <c:forEach items="${Cart}" var="item">
                <input type="hidden" id="qq" value="q${item["id"]}">
                <tr>
                    <td > <img src="../WebTool/GetPicwithzoom.jsp?pp=${item["id"]}&x=60&y=60"></td>
                    <td align="center">${item["name"]}</td>
                    <td align="center">${item["type"]}</td>
                    <td align="center">${item["price"]}</td>
                    <td align="center">
                        
                         <select id="quantity" class="quantity" name="q${item["id"]}" onchange="ch()">
                                             
                            <c:forEach begin="0" end="${item.stock>10?10:item.stock}" var="i">
                                <option ${i==item.quantity?"selected='selected'":""}>${i}</option>
                            </c:forEach>
                        </select>
                    </td>
                    <td align="center">${item["subTotal"]}</td>
                </tr>
            </c:forEach> 
        </table>  
            <table width="600" cellpadding="10" align="center" class="legend">
            <tr>
                <td align="right"><b>運費：</b></td>
                <td>${shipping}</td>
                <td align="right"><b>小計：</b></td>
                <td>${amount}</td>
            </tr>
            <tr>
                <td align="right">&nbsp;</td>
                <td>&nbsp;</td>
                <td align="right"><b>總金額：</b></td>
                <td>${total}</td>
            </tr>            
        </table>